Skip to content
Snippets Groups Projects

assoc ctrl: store restricted clients in file

Merged Filip Matusiak requested to merge filmat/devel-16360 into devel
Compare and
5 files
+ 429
44
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 2
33
@@ -3078,37 +3078,6 @@ char *get_timestamp_old(time_t *t, char **tbuf)
@@ -3078,37 +3078,6 @@ char *get_timestamp_old(time_t *t, char **tbuf)
return *tbuf;
return *tbuf;
}
}
char *get_timestamp(time_t *t, char *tbuf)
{
char tmpbuf[64] = {0};
struct tm res;
char sign;
long int toff, toff_hour, toff_min;
const time_t now = time(t);
if (!tbuf)
return NULL;
/* E.g. "2019-02-11T06:42:31.23039-08:00" */
localtime_r(&now, &res);
tzset();
toff = timezone;
sign = toff > 0 ? '-' : '+';
toff *= -1L;
toff_hour = toff / 3600;
toff_min = (toff % 3600) / 60;
snprintf(tmpbuf, 63, "%04d-%02d-%02dT%02d:%02d:%02d%c%02ld:%02ld",
res.tm_year + 1900, res.tm_mon + 1, res.tm_mday,
res.tm_hour, res.tm_min, res.tm_sec,
sign, toff_hour, toff_min);
snprintf(tbuf, 64, "%s", tmpbuf);
return tbuf;
}
int agent_gen_timestamp_tlv(struct agent *agent, struct cmdu_buff *frm)
int agent_gen_timestamp_tlv(struct agent *agent, struct cmdu_buff *frm)
{
{
int ret;
int ret;
@@ -3123,7 +3092,7 @@ int agent_gen_timestamp_tlv(struct agent *agent, struct cmdu_buff *frm)
@@ -3123,7 +3092,7 @@ int agent_gen_timestamp_tlv(struct agent *agent, struct cmdu_buff *frm)
/* Define the TLV */
/* Define the TLV */
t->type = MAP_TLV_TIMESTAMP;
t->type = MAP_TLV_TIMESTAMP;
data = (struct tlv_timestamp *) t->data;
data = (struct tlv_timestamp *) t->data;
get_timestamp(NULL, tsp);
time_to_timestr(NULL, tsp);
data->len = strlen(tsp);
data->len = strlen(tsp);
memcpy(data->timestamp, (uint8_t *)tsp, data->len);
memcpy(data->timestamp, (uint8_t *)tsp, data->len);
t->len = sizeof(*data) + data->len;
t->len = sizeof(*data) + data->len;
@@ -3230,7 +3199,7 @@ int agent_gen_ch_scan_response_tlv(struct agent *a, struct cmdu_buff *cmdu,
@@ -3230,7 +3199,7 @@ int agent_gen_ch_scan_response_tlv(struct agent *a, struct cmdu_buff *cmdu,
trace("\t INFO: radio " MACFMT ", opclass %d, channel %d\n",
trace("\t INFO: radio " MACFMT ", opclass %d, channel %d\n",
MAC2STR(radio_mac), opclass_id, ch->channel);
MAC2STR(radio_mac), opclass_id, ch->channel);
get_timestamp(NULL, tsp);
time_to_timestr(NULL, tsp);
memcpy(ch->tsp, tsp, strlen(tsp));
memcpy(ch->tsp, tsp, strlen(tsp));
t = cmdu_reserve_scan_response_tlv(cmdu, reserve_len,
t = cmdu_reserve_scan_response_tlv(cmdu, reserve_len,
tsp, radio_mac, opclass_id, ch, status, &offset);
tsp, radio_mac, opclass_id, ch, status, &offset);
Loading