-
Notifications
You must be signed in to change notification settings - Fork 335
Fatal Error: linux/compiler_types.h: No such file or directory #393
Comments
Hello, I think that as a workaround, you can include these three folders in this order:
But that's a workaround and apparently not recommended. I would suggest you to follow instructions from https://kernelnewbies.org/KernelHeaders#User_space_programs
Please re-open this issue if it doesn't help. |
Hello, I met the same problem that compiler_types.h:No such file or directory, and I have tried to include these three folders in this order,
|
@cxht do you have other "include"? Which version of the MPTCP kernel are you using? What's the compiler command you used? |
@matttbe Thanks for your attention, I have addressed this problem after checking include headers, but another problem appears. When I call getsockopt() function, it always return -1. Is the location of getsockopt wrong or other? My entire code is here: #include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <linux/tcp.h>
#include <stdio.h>
#define MPTCP_INFO_FLAG_SAVE_MASTER 0x01
int main()
{
struct mptcp_info minfo;
struct mptcp_meta_info meta_info;
struct tcp_info initial;
struct tcp_info others[3];
struct mptcp_sub_info others_info[3];
int val = MPTCP_INFO_FLAG_SAVE_MASTER;
minfo.tcp_info_len = sizeof(struct tcp_info);
minfo.sub_len = sizeof(others);
minfo.meta_len = sizeof(struct mptcp_meta_info);
minfo.meta_info = &meta_info;
minfo.initial = &initial;
minfo.subflows = &others;
minfo.sub_info_len = sizeof(struct mptcp_sub_info);
minfo.total_sub_info_len = sizeof(others_info);
minfo.subflow_info = &others_info;
int sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(sockfd == -1)
printf("\nsocket error");
struct sockaddr_in serv_addr;
memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = inet_addr("10.2.0.1");
serv_addr.sin_port = htons(8080);
char pathmanager[] = "fullmesh";
int a =setsockopt(sockfd, 6, MPTCP_PATH_MANAGER, pathmanager, sizeof(pathmanager));
printf("\nfullmesh a=%d",a);
char scheduler[] = "roundrobin";
a = setsockopt(sockfd, 6, MPTCP_SCHEDULER, scheduler, sizeof(scheduler));
printf("\nsch a=%d",a);
connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
a= setsockopt(sockfd, 6, MPTCP_INFO, &val, sizeof(val));
printf("\n save master=%d",a);
int m = getsockopt(sockfd, 6, MPTCP_INFO, &minfo, sizeof(minfo));
if(m==-1)
{
printf("\ncannot getsockopt(MPTCP_INFO)");
//printf("\nerrno = %s\n",strerror(errno));
}
printf("bytes:%d\nuna:%d\nrtt:%d\n",minfo.initial->tcpi_bytes_sent,minfo.initial->tcpi_unacked,minfo.initial->tcpi_rtt);
char sendbuf[1024];
char recvbuf[1024];
FILE *f ;
f=fopen("random","r");
while(fgets(sendbuf, sizeof(sendbuf), f) > 0)
{
send(sockfd, sendbuf, strlen(sendbuf),0);
if(strcmp(sendbuf,"exit\n")==0)
break;
recv(sockfd, recvbuf, sizeof(recvbuf),0);
//fputs(recvbuf, stdout);
memset(sendbuf, 0, sizeof(sendbuf));
memset(recvbuf, 0, sizeof(recvbuf));
}
close(sockfd);
close(f);
return 0;
} |
Good! We can keep this ticket closed.
The issue seems different, may you create a new ticket with an answer for all these questions:
|
I am trying to add mptcp linux kernel header files path into my code but I am getting the error given below. I had a look into the issues that were mentioned here already. I did use gcc -I /usr/src/linux-headers-4.19.55.mptcp/include/uapi. Kindly let me know what to be done?
The text was updated successfully, but these errors were encountered: