Find Jobs
Hire Freelancers

C web service request in VM linux C not response

$30-250 USD

Fechado
Publicado há aproximadamente 8 anos

$30-250 USD

Pago na entrega
-1 down vote favorite I am working with a Linux based box which does video control. I need to add partial ONVIF support so that it can support multiple cameras with the same interface. I started writing code on my Windows development machine using virtual Linux environment, and succeeded in making some basic requests that got answered. However, I had to cheat a little. I didn't see a way with CURL to make the original WS-Discovery; to skip that part at the beginning, I listened to ONVIF manager with Wireshark, looked at the results of the WS-Discovery there, and took the results as the start of my program. Now I started to work backwards, and implement the WS-discovery. It seems pretty straightforward and I found several samples of C code. For example, I tried this: [login to view URL] and others. (Basically, open a socket, bind it to a port, set the options to allow broadcast, send it to a broadcast address, and see the results come in). However, no matter how I have written it, not only don't I get any responses - I cannot see the request being sent on Wireshark. Nothing happens. Even though all functions return successfully (opening socket, binding, option setting, sending, etc..) - nothing comes out. Now, ONVIF manager manages to send these packets - but from the Windows machine, not the Linux virtual machine. I thought that that might be the issue - but the other code I wrote which sends to specific addresses worked fine from the virtual machine (using the IP address which belongs to both the Windows host and the Linux VM). Here is one of the last samples I tested: /* * build instructions * * gcc -o bclient bclient.c * * Usage: * ./bclient <serverport> */ #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #define MAXBUF 65536 const char *data = "<s:Envelope xmlns:s=\"[login to view URL]\" xmlns:a=\"[login to view URL]\"><s:Header><a:Action s:mustUnderstand=\"1\">[login to view URL]</a:Action><a:MessageID>uuid:2c7722b3-ae7d-475c-b89d-0d1885784b9f</a:MessageID><a:ReplyTo><a:Address>[login to view URL]</a:Address></a:ReplyTo><a:To s:mustUnderstand=\"1\">urn:schemas-xmlsoap-org:ws:2005:04:discovery</a:To></s:Header><s:Body><Probe xmlns=\"[login to view URL]\"><d:Types xmlns:d=\"[login to view URL]\" xmlns:dp0=\"[login to view URL]\">dp0:NetworkVideoTransmitter</d:Types></Probe></s:Body></s:Envelope>"; int main(void) { int sock, status, buflen, sinlen; char buffer[MAXBUF]; struct sockaddr_in sock_in; int yes = 1; sinlen = sizeof(struct sockaddr_in); memset(&sock_in, 0, sinlen); buflen = MAXBUF; sock = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP); sock_in.sin_addr.s_addr = htonl(INADDR_ANY); sock_in.sin_port = htons(0); sock_in.sin_family = PF_INET; status = bind(sock, (struct sockaddr *)&sock_in, sinlen); printf("Bind Status = %d\n", status); status = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(int) ); printf("Setsockopt Status = %d\n", status); sock_in.sin_addr.s_addr=inet_addr("[login to view URL]"); sock_in.sin_port = 3207; /* port number */ sock_in.sin_family = PF_INET; sprintf(buffer,"%s", data); buflen = strlen(buffer); status = sendto(sock, buffer, buflen, 0, (struct sockaddr *)&sock_in, sinlen); printf("sendto Status = %d\n", status); shutdown(sock, 2); close(sock); That runs, each function reports success - and nothing is sent. what I am missing? Need solution asap
ID do Projeto: 10469242

Sobre o projeto

6 propostas
Projeto remoto
Ativo há 8 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
6 freelancers estão ofertando em média $135 USD for esse trabalho
Avatar do Usuário
I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 6 years. My work is online game developing, and mainly focus on client side, using c++ under windows environment. I used c++ to make many great projects, for example, I made the tools which can convert java files into c++ scripts, of course garbage collection included, this job is very similar to a compiler, and is very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$150 USD em 2 dias
4,9 (159 avaliações)
7,1
7,1
Avatar do Usuário
Hi & shalom, Can you state the virtual software you are using? how is configure the network part in the virtual software. And check the firewall config in your windows!!! Best regards, David 30+ years C/Unix-HP-UX-Solaris-AIX/Linux programmer, performance +10 years embedded Linux (openwrt/raspberry/odroid) & Arduino. Oracle OVM admin Unix/Linux Kernel support & dev Python dev. PHP dev. Uni* scripting TCP/IP dev. mysql/mariadb/sql adm&dev NFS (admin & rpc programming) XML
$55 USD em 1 dia
5,0 (12 avaliações)
5,5
5,5
Avatar do Usuário
Hello, I can do this. I have been programming in c, c++ and Linux for last 8+ years. I have developed many complex software's involving System Programming, Network Programming , Socket Programming,, Shared Memory, IPC, Queue etc .. Check my profile: https://www.freelancer.com/u/rajeshpal007.html -Rajesh
$315 USD em 5 dias
5,0 (24 avaliações)
5,0
5,0
Avatar do Usuário
I am sure I can help you with this. Please let me know if you'r interested so we can discuss the details and the help you need.
$100 USD em 0 dia
5,0 (3 avaliações)
2,9
2,9

Sobre o cliente

Bandeira do(a) ISRAEL
Jerusalem, Israel
5,0
22
Membro desde fev. 17, 2011

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.