Find Jobs
Hire Freelancers

C web service request in VM linux C not response

$30-250 USD

Cerrado
Publicado hace alrededor de 8 años

$30-250 USD

Pagado a la 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 del proyecto: 10469242

Información sobre el proyecto

6 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
6 freelancers están ofertando un promedio de $135 USD por este trabajo
Avatar del usuario
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 en 2 días
4,9 (159 comentarios)
7,1
7,1
Avatar del usuario
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 en 1 día
5,0 (12 comentarios)
5,5
5,5
Avatar del usuario
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 en 5 días
5,0 (24 comentarios)
5,0
5,0
Avatar del usuario
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 en 0 día
5,0 (3 comentarios)
2,9
2,9

Sobre este cliente

Bandera de ISRAEL
Jerusalem, Israel
5,0
22
Miembro desde feb 17, 2011

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos 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)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.