📅  最后修改于: 2023-12-03 15:27:33.797000             🧑  作者: Mango
在 Wipro 的 L2L3 协议开发岗位中,需要一名经验丰富的程序员来应对挑战。下面是一些需要掌握的技能和经验:
void tcpip_protocol(int port) {
int sock;
struct sockaddr_in server;
char message[1000] , server_reply[2000];
sock = socket(AF_INET , SOCK_STREAM , 0);
if (sock == -1)
printf("Could not create socket");
puts("Socket created");
server.sin_addr.s_addr = inet_addr("127.0.0.1");
server.sin_family = AF_INET;
server.sin_port = htons( port );
//Connect to remote server
if (connect(sock , (struct sockaddr *)&server , sizeof(server)) < 0) {
perror("connect failed. Error");
return 1;
}
puts("Connected\n");
//keep communicating with server
while(1) {
printf("Enter message : ");
scanf("%s" , message);
//Send some data
if (send(sock , message , strlen(message) , 0) < 0) {
puts("Send failed");
return 1;
}
//Receive a reply from the server
if (recv(sock , server_reply , 2000 , 0) < 0) {
puts("recv failed");
break;
}
puts("Server reply :");
puts(server_reply);
}
close(sock);
return 0;
}
# 注意此处为Python代码
import json
import os
import sys
import signal
import time
import datetime
class SwitchConfig():
def __init__(self, results):
self.ip = results.get('ip', None)
self.username = results.get('username', None)
self.password = results.get('password', None)
self.method = results.get('method', None)
self.port = results.get('port', None)
self.connectionHandler = results.get('connectionHandler', None)
class Result():
def __init__(self, status, output):
self.status = status
self.output = output
def generateResult(status, output):
return Result(status, output)
def switch_config_runner(switchList):
print (datetime.datetime.now())
SWITCH_CONFIG = 'switch-config'
for switch in switchList:
print ("\nsession Start >>> " + switch.ip + " <<<\n"+ "step: " + SWITCH_CONFIG )
switch.connectionHandler.connect()
switch.connectionHandler.remote_shell()
switch.connectionHandler.login()
switch.connectionHandler.cmd("vlan database")
switch.connectionHandler.cmd("vlan 10 exit")
switch.connectionHandler.cmd("exit")
switch.connectionHandler.cmd("interface ethernet1/1")
switch.connectionHandler.cmd("switchport access vlan 10")
switch.connectionHandler.cmd("exit")
switch.connectionHandler.cmd("end")
switch.connectionHandler.cmd("show running-config")
switch.connectionHandler.logout()
print (datetime.datetime.now())
return generateResult(True, "Switch have been Configured Successfully.")
#!/bin/bash
echo "Building and testing the project"
echo "--------------------------------"
mvn clean install
echo ""
echo "Running the application"
echo "-----------------------"
java -jar target/myapplication.jar
echo ""
echo "Deployment in progress"
echo "----------------------"
scp target/myapplication.jar user@10.0.0.1:/opt/myapplication.jar
echo ""
echo "Deployed successfully!"
echo "----------------------"
如果你是一名具备上述技能和经验的程序员,那么你将成为 Wipro L2L3 协议开发团队中的重要一员。