I found this for timeseal. https://github.com/fbergo/zseal
I want to do 3 things. One is do whatever it takes to properly initalize it, two is receive data and three is send data.
I can make it connect if i ignore this code in main()
if i capture whats coming into this function i can print whats coming in in the socket in the apps console and see i'm connecting:if (n==0) {
fprintf(stderr,"EOF from stdin\n");
exit(0);
}
i can send data with zsend but zsend calls zwrite and i cant figure out why sending and receiving is mixed. i have to hack the code a bit to get it work becasue i got write now writing to consolestatic void zwrite(int fd,const char *buffer,int n) {
if (write(fd,buffer,n)==-1) zdie(1);
}
I have no idea what this function is doing but i think its needed to intialize.static void zsend(int fd, char *buffer, int *rd)
Also i cant find on project page what this "popen("uname -a 2>&1","r");" -- uname file is.static void zid(char *dest, int sz) {
char user[32], uname[128], tmp[512];
FILE *f;
struct passwd *pw;
memset(user,0,32);
memset(uname,0,128);
pw = getpwuid(geteuid());
if (pw != NULL) strncpy(user,pw->pw_name,31);
f = popen("uname -a 2>&1","r");
if (f!=NULL) {
memset(tmp,0,512);
if (fgets(tmp, 511, f)!=NULL) {
zchomp(tmp);
strncpy(uname,tmp,127);
}
pclose(f);
}
zclean(user);
zclean(uname);
memset(dest,0,sz);
snprintf(dest,sz-1,"%s (zseal %s)|%s",user, VERSION, uname);
}
End result, if i hack away at it i can connect, send and receivec but it still says timseal off.
On ios you cant run another process so i need to integrate this code into my app vs simply run a unix executable or I cant have timeseal on ios.
Mike