I have long been interested in one question, but I do not have enough knowledge or experience to at least understand how to approach it. As I am very far from networking technologies (different requests and their processing), I would be grateful for any help or hint in solving this issue. I assume I need a program like wireshark or something similar to capture network packets. Okay, I have it. I tried to track something down there, but a ton of information was thrown at me. I almost drowned in it. So I would also appreciate it if someone knows a simple user manual for this program. For kinders. For the youngest children who do not yet have teeth

Of course I know there's filtering, but it's still very complicated for me. Maybe someone can at least tell me the algorithm for my actions in this case? That would be very helpful.
So...
The foreplay is over. Let's get down to task.
I have a TP-LINK router. My copmuter gets internet through it by wire (patchcord). I also occasionally connect to it via wi-fi (for example, by connecting a smartphone). But... I don't want wi-fi to work always, but only when I need it. It is inconvenient to go through the web interface every time and change the switch position. Hence the question: how can this be done by program?
Attention! I am interested in this method, not in telnet.
I have seen this code on this forum:
Code: Select all
Define.s UserName, Password, EncodedLogin, TicketString, FullResponse, ResponseCode, URLString
Define *Login, Running
If Not InitNetwork()
Debug "Problem initializing the network! Program Ending"
End 101
EndIf
NewMap Header.s()
Username = "admin"
Password = "admin"
*Login = UTF8(UserName + ":" + Password)
EncodedLogin = Base64Encoder(*Login, MemorySize(*Login) - 1)
Header("Authorization") = "Basic " + EncodedLogin
Header("Accept") = "application/xml"
Header("Content-Type") = "application/xml"
ForEach Header()
Debug MapKey(Header()) + ": " + Header()
Next
Debug ""
Debug "---------------------------------------------------------------"
Debug ""
URLString = "192.168.0.1"
Running = HTTPRequest(#PB_HTTP_Get, URLString, "", 0, Header())
If Running
FullResponse = HTTPInfo(Running, #PB_HTTP_Response)
ResponseCode = HTTPInfo(Running, #PB_HTTP_StatusCode)
FinishHTTP(Running)
Debug "Running: " + Running
Debug "Response Code: " + ResponseCode
Debug "Response: " + FullResponse
EndIf
Also full response:
Code: Select all
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META http-equiv=Content-Type content="text/html; charset=utf-8" />
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Expires content=0>
<!--
<link rel="stylesheet" href="../css/login.css" type="text/css" />
<link rel="stylesheet" href="../img/login/login.css" type="text/css" />
-->
<style type="text/css">
body{
font-family:Arial, sans-serief;
background-color:#FFFFFF;
margin:0px;
padding:0px;
}
div.loginBox
{
/*display: block;*/
position:relative;
margin-top:10%;
text-align:center;
}
.nd {
display: none !important;
}
.noteDiv{
color:gray;
...
Has anyone done this kind of thing before?
Thank you in advance for any feedback.