mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 14:23:50 -07:00
added the udpv6 and also try to identify when v6 is used (tcp/udp)
This commit is contained in:
parent
a35bfbb13e
commit
0dc921c6b7
5 changed files with 22 additions and 7 deletions
|
@ -58,6 +58,7 @@ typedef enum {
|
||||||
PM3_TCPv4,
|
PM3_TCPv4,
|
||||||
PM3_TCPv6,
|
PM3_TCPv6,
|
||||||
PM3_UDPv4,
|
PM3_UDPv4,
|
||||||
|
PM3_UDPv6,
|
||||||
PM3_NONE,
|
PM3_NONE,
|
||||||
} CommunicationProtol_t;
|
} CommunicationProtol_t;
|
||||||
|
|
||||||
|
|
|
@ -277,6 +277,9 @@ main_loop(char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) {
|
||||||
case PM3_UDPv4:
|
case PM3_UDPv4:
|
||||||
prompt_net = PROXPROMPT_NET_UDPV4;
|
prompt_net = PROXPROMPT_NET_UDPV4;
|
||||||
break;
|
break;
|
||||||
|
case PM3_UDPv6:
|
||||||
|
prompt_net = PROXPROMPT_NET_UDPV6;
|
||||||
|
break;
|
||||||
case PM3_NONE:
|
case PM3_NONE:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#define PROXPROMPT_NET_TCPV4 "|" _RL_BOLD_GREEN_("tcp")
|
#define PROXPROMPT_NET_TCPV4 "|" _RL_BOLD_GREEN_("tcp")
|
||||||
#define PROXPROMPT_NET_UDPV4 "|" _RL_BOLD_GREEN_("udp")
|
#define PROXPROMPT_NET_UDPV4 "|" _RL_BOLD_GREEN_("udp")
|
||||||
#define PROXPROMPT_NET_TCPV6 "|" _RL_BOLD_GREEN_("tcp v6")
|
#define PROXPROMPT_NET_TCPV6 "|" _RL_BOLD_GREEN_("tcp v6")
|
||||||
|
#define PROXPROMPT_NET_UDPV6 "|" _RL_BOLD_GREEN_("udp v6")
|
||||||
|
|
||||||
|
|
||||||
#define PROXHISTORY "history.txt"
|
#define PROXHISTORY "history.txt"
|
||||||
|
|
|
@ -131,6 +131,10 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// assume v4
|
||||||
|
g_conn.send_via_ip = PM3_TCPv4;
|
||||||
|
|
||||||
// find the port
|
// find the port
|
||||||
char *lColon = strchr(addrPortStr, ':');
|
char *lColon = strchr(addrPortStr, ':');
|
||||||
char *rColon = strrchr(addrPortStr, ':');
|
char *rColon = strrchr(addrPortStr, ':');
|
||||||
|
@ -151,6 +155,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
} else {
|
} else {
|
||||||
portstr = "18888";
|
portstr = "18888";
|
||||||
}
|
}
|
||||||
|
g_conn.send_via_ip = PM3_TCPv6;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle the end of the address
|
// handle the end of the address
|
||||||
|
@ -207,7 +212,6 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
return INVALID_SERIAL_PORT;
|
return INVALID_SERIAL_PORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_conn.send_via_ip = PM3_TCPv4;
|
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,6 +248,9 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Assume v4
|
||||||
|
g_conn.send_via_ip = PM3_UDPv4;
|
||||||
|
|
||||||
// find the port
|
// find the port
|
||||||
char *lColon = strchr(addrPortStr, ':');
|
char *lColon = strchr(addrPortStr, ':');
|
||||||
char *rColon = strrchr(addrPortStr, ':');
|
char *rColon = strrchr(addrPortStr, ':');
|
||||||
|
@ -264,6 +271,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
} else {
|
} else {
|
||||||
portstr = "18888";
|
portstr = "18888";
|
||||||
}
|
}
|
||||||
|
g_conn.send_via_ip = PM3_UDPv6;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle the end of the address
|
// handle the end of the address
|
||||||
|
@ -279,7 +287,6 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
|
|
||||||
info.ai_family = PF_UNSPEC;
|
info.ai_family = PF_UNSPEC;
|
||||||
info.ai_socktype = SOCK_DGRAM;
|
info.ai_socktype = SOCK_DGRAM;
|
||||||
// info.ai_protocol = SOL_UDP;
|
|
||||||
|
|
||||||
int s = getaddrinfo(addrstr, portstr, &info, &addr);
|
int s = getaddrinfo(addrstr, portstr, &info, &addr);
|
||||||
if (s != 0) {
|
if (s != 0) {
|
||||||
|
@ -314,8 +321,6 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
|
|
||||||
sp->fd = sfd;
|
sp->fd = sfd;
|
||||||
sp->udpBuffer = RingBuf_create(MAX(sizeof(PacketResponseNGRaw), sizeof(PacketResponseOLD)) * 30);
|
sp->udpBuffer = RingBuf_create(MAX(sizeof(PacketResponseNGRaw), sizeof(PacketResponseOLD)) * 30);
|
||||||
|
|
||||||
g_conn.send_via_ip = PM3_UDPv4;
|
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,9 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Assume v4
|
||||||
|
g_conn.send_via_ip = PM3_TCPv4;
|
||||||
|
|
||||||
// find the port
|
// find the port
|
||||||
char *lColon = strchr(addrPortStr, ':');
|
char *lColon = strchr(addrPortStr, ':');
|
||||||
char *rColon = strrchr(addrPortStr, ':');
|
char *rColon = strrchr(addrPortStr, ':');
|
||||||
|
@ -155,6 +158,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
} else {
|
} else {
|
||||||
portstr = "18888";
|
portstr = "18888";
|
||||||
}
|
}
|
||||||
|
g_conn.send_via_ip = PM3_TCPv6;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle the end of the address
|
// handle the end of the address
|
||||||
|
@ -225,7 +229,6 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
free(sp);
|
free(sp);
|
||||||
return INVALID_SERIAL_PORT;
|
return INVALID_SERIAL_PORT;
|
||||||
}
|
}
|
||||||
g_conn.send_via_ip = PM3_TCPv4;
|
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,6 +266,9 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Assume v4
|
||||||
|
g_conn.send_via_ip = PM3_UDPv4;
|
||||||
|
|
||||||
// find the port
|
// find the port
|
||||||
char *lColon = strchr(addrPortStr, ':');
|
char *lColon = strchr(addrPortStr, ':');
|
||||||
char *rColon = strrchr(addrPortStr, ':');
|
char *rColon = strrchr(addrPortStr, ':');
|
||||||
|
@ -283,6 +289,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
} else {
|
} else {
|
||||||
portstr = "18888";
|
portstr = "18888";
|
||||||
}
|
}
|
||||||
|
g_conn.send_via_ip = PM3_UDPv6;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle the end of the address
|
// handle the end of the address
|
||||||
|
@ -345,8 +352,6 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
|
|
||||||
sp->hSocket = hSocket;
|
sp->hSocket = hSocket;
|
||||||
sp->udpBuffer = RingBuf_create(MAX(sizeof(PacketResponseNGRaw), sizeof(PacketResponseOLD)) * 30);
|
sp->udpBuffer = RingBuf_create(MAX(sizeof(PacketResponseNGRaw), sizeof(PacketResponseOLD)) * 30);
|
||||||
|
|
||||||
g_conn.send_via_ip = PM3_UDPv4;
|
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue