Find Jobs
Hire Freelancers

C web service request in VM linux C not response

$30-250 USD

Ditutup
Dibuat sekitar 8 tahun yang lalu

$30-250 USD

Dibayar ketika dikirim
-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 Proyek: 10469242

Tentang proyek

6 proposal
Proyek remot
Aktif 8 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
6 freelancer menawar dengan rata-rata $135 USD untuk pekerjaan ini
Avatar Pengguna
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 dalam 2 hari
4,9 (159 ulasan)
7,1
7,1
Avatar Pengguna
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 dalam 1 hari
5,0 (12 ulasan)
5,5
5,5
Avatar Pengguna
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 dalam 5 hari
5,0 (24 ulasan)
5,0
5,0
Avatar Pengguna
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 dalam 0 hari
5,0 (3 ulasan)
2,9
2,9

Tentang klien

Bendera ISRAEL
Jerusalem, Israel
5,0
22
Anggota sejak Feb 17, 2011

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.