• Home
  • Raw
  • Download

Lines Matching refs:t

216 void handle_online(atransport *t)  in handle_online()  argument
219 t->online = 1; in handle_online()
222 void handle_offline(atransport *t) in handle_offline() argument
226 t->online = 0; in handle_offline()
227 run_transport_disconnects(t); in handle_offline()
271 static void send_ready(unsigned local, unsigned remote, atransport *t) in send_ready() argument
278 send_packet(p, t); in send_ready()
281 static void send_close(unsigned local, unsigned remote, atransport *t) in send_close() argument
288 send_packet(p, t); in send_close()
341 static void send_connect(atransport *t) in send_connect() argument
350 send_packet(cp, t); in send_connect()
353 void send_auth_request(atransport *t) in send_auth_request() argument
359 ret = adb_auth_generate_token(t->token, sizeof(t->token)); in send_auth_request()
360 if (ret != sizeof(t->token)) { in send_auth_request()
366 memcpy(p->data, t->token, ret); in send_auth_request()
370 send_packet(p, t); in send_auth_request()
373 static void send_auth_response(uint8_t *token, size_t token_size, atransport *t) in send_auth_response() argument
379 ret = adb_auth_sign(t->key, token, token_size, p->data); in send_auth_response()
389 send_packet(p, t); in send_auth_response()
392 static void send_auth_publickey(atransport *t) in send_auth_publickey() argument
408 send_packet(p, t); in send_auth_publickey()
411 void adb_auth_verified(atransport *t) in adb_auth_verified() argument
413 handle_online(t); in adb_auth_verified()
414 send_connect(t); in adb_auth_verified()
417 static char *connection_state_name(atransport *t) in connection_state_name() argument
419 if (t == NULL) { in connection_state_name()
423 switch(t->connection_state) { in connection_state_name()
459 void parse_banner(char *banner, atransport *t) in parse_banner() argument
482 qual_overwrite(&t->product, cp); in parse_banner()
484 qual_overwrite(&t->model, cp); in parse_banner()
486 qual_overwrite(&t->device, cp); in parse_banner()
495 t->connection_state = CS_BOOTLOADER; in parse_banner()
502 t->connection_state = CS_DEVICE; in parse_banner()
509 t->connection_state = CS_RECOVERY; in parse_banner()
516 t->connection_state = CS_SIDELOAD; in parse_banner()
521 t->connection_state = CS_HOST; in parse_banner()
524 void handle_packet(apacket *p, atransport *t) in handle_packet() argument
537 send_packet(p, t); in handle_packet()
538 if(HOST) send_connect(t); in handle_packet()
540 t->connection_state = CS_OFFLINE; in handle_packet()
541 handle_offline(t); in handle_packet()
542 send_packet(p, t); in handle_packet()
548 if(t->connection_state != CS_OFFLINE) { in handle_packet()
549 t->connection_state = CS_OFFLINE; in handle_packet()
550 handle_offline(t); in handle_packet()
553 parse_banner((char*) p->data, t); in handle_packet()
556 handle_online(t); in handle_packet()
557 if(!HOST) send_connect(t); in handle_packet()
559 send_auth_request(t); in handle_packet()
565 t->connection_state = CS_UNAUTHORIZED; in handle_packet()
566 t->key = adb_auth_nextkey(t->key); in handle_packet()
567 if (t->key) { in handle_packet()
568 send_auth_response(p->data, p->msg.data_length, t); in handle_packet()
571 send_auth_publickey(t); in handle_packet()
574 if (adb_auth_verify(t->token, p->data, p->msg.data_length)) { in handle_packet()
575 adb_auth_verified(t); in handle_packet()
576 t->failed_auth_attempts = 0; in handle_packet()
578 if (t->failed_auth_attempts++ > 10) in handle_packet()
580 send_auth_request(t); in handle_packet()
583 adb_auth_confirm_key(p->data, p->msg.data_length, t); in handle_packet()
588 if (t->online && p->msg.arg0 != 0 && p->msg.arg1 == 0) { in handle_packet()
593 send_close(0, p->msg.arg0, t); in handle_packet()
595 s->peer = create_remote_socket(p->msg.arg0, t); in handle_packet()
597 send_ready(s->id, s->peer->id, t); in handle_packet()
604 if (t->online && p->msg.arg0 != 0 && p->msg.arg1 != 0) { in handle_packet()
608 s->peer = create_remote_socket(p->msg.arg0, t); in handle_packet()
616 p->msg.arg0, p->msg.arg1, s->peer->id, p->msg.arg1, t->serial); in handle_packet()
623 if (t->online && p->msg.arg1 != 0) { in handle_packet()
635 if (p->msg.arg0 == 0 && s->peer && s->peer->transport != t) { in handle_packet()
637 p->msg.arg1, t->serial, s->peer->transport->serial); in handle_packet()
646 if (t->online && p->msg.arg0 != 0 && p->msg.arg1 != 0) { in handle_packet()
653 send_ready(s->id, rid, t); in handle_packet()
745 static void listener_disconnect(void* _l, atransport* t) in listener_disconnect() argument
1007 time_t t; in start_device_log() local
1018 time(&t); in start_device_log()
1019 localtime_r(&t, &now); in start_device_log()
1627 atransport *t = find_transport(serial); in handle_host_request() local
1629 if (t) { in handle_host_request()
1630 unregister_transport(t); in handle_host_request()