📄 agent_utils.h
字号:
/* $Id: agent_utils.h,v 1.11 2001/08/05 21:54:26 jm Exp $ * Independent help routines for FA and HA * * Dynamic hierarchial IP tunnel * Copyright (C) 1998-2001, Dynamics group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See README and COPYING for * more details. */#ifndef AGENT_UTILS_H#define AGENT_UTILS_H#include <time.h>#include <sys/time.h>#include "message.h"struct msg_key *dynamics_do_rsa_encrypt(unsigned char const *sk, int sk_len, const struct msg_key *pubkey);int dynamics_check_sendto(int ret, int len, char *error);int dynamics_open_udp_socket(int socket_priority, struct in_addr addr, short int port, char *dev);/* IP_PKTINFO related definitions are not available in all the libc versions * in appropriate form - define them here */#ifndef CMSG_ALIGN#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )#endif#ifndef CMSG_DATA#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + \ CMSG_ALIGN(sizeof(struct cmsghdr))))#endif#define DYNAMICS_CMSG_NXTHDR(mhdr, cmsg) dynamics_cmsg_nxthdr((mhdr), (cmsg))struct cmsghdr * dynamics_cmsg_nxthdr(struct msghdr *__msg, struct cmsghdr *__cmsg);#ifndef IP_PKTINFO#define IP_PKTINFO 8#endifstruct _in_pktinfo { unsigned int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst; /* Routing destination address */ struct in_addr ipi_addr; /* Header Destination address */};#ifndef IP_RCVERR#define IP_RCVERR 11#endif/* struct sock_extended_err is available only in kernel headers, so here is a * local copy of the structure */struct dynamics_sock_extended_err{ __u32 ee_errno; __u8 ee_origin; __u8 ee_type; __u8 ee_code; __u8 ee_pad; __u32 ee_info; __u32 ee_data;};#ifndef SO_EE_OFFENDER#define SO_EE_OFFENDER(ee) ((struct sockaddr *) ((ee) + 1))#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -