}
+/**
+ * Convert an expiration time to the respective year (rounds)
+ *
+ * @param at absolute time
+ * @return year a year (after 1970), 0 on error
+ */
+unsigned int
+GNUNET_FS_time_to_year (struct GNUNET_TIME_Absolute at)
+{
+ struct tm *t;
+ time_t tp;
+
+ tp = at.abs_value / 1000; /* ms to seconds */
+ t = gmtime (&tp);
+ if (t == NULL)
+ return 0;
+ return t->tm_year + 1900;
+
+}
/* end of fs_misc.c */
GNUNET_FS_year_to_time (unsigned int year);
+/**
+ * Convert an expiration time to the respective year (rounds)
+ *
+ * @param at absolute time
+ * @return year a year (after 1970), 0 on error
+ */
+unsigned int
+GNUNET_FS_time_to_year (struct GNUNET_TIME_Absolute at);
+
+
/**
* Handle to the file-sharing service.
*/
const char *start;
char ifc[12];
char addrstr[128];
+ char bcstr[128];
FILE *f;
int have_ifc;
struct sockaddr_in a4;
while (('\0' != *start) && (isspace (*start)))
start++;
if ( /* Linux */
- (1 == SSCANF (start, "inet addr:%127s", addrstr)) ||
+ (2 == SSCANF (start, "inet addr:%127s Bcast:%127s", addrstr, bcstr)) ||
(1 == SSCANF (start, "inet6 addr:%127s", addrstr)) ||
/* Solaris, OS X */
(1 == SSCANF (start, "inet %127s", addrstr)) ||