Commit f44fa35b authored by Aurelio Colosimo's avatar Aurelio Colosimo

network handling implementation for UDP and skeleton for IEEE 802.3

parent 8d93cedb
This diff is collapsed.
......@@ -53,11 +53,10 @@ int main(int argc, char **argv)
)
exit(__LINE__);
if (posix_open_ch(ppi, ifname))
pp_diag_fatal(ppi, "open_ch", strerror(errno));
pp_open_instance(ppi, NULL);
OPTS(ppi)->iface_name = ifname;
if (pp_parse_cmdline(ppi, argc, argv) < 0)
return -1;
......
......@@ -6,14 +6,16 @@
* These are the functions provided by the various posix files
*/
#define POSIX_ARCH(ppi) ((struct posix_arch_data*)(ppi->arch_data))
struct posix_arch_data {
struct timeval tv;
int rcv_switch; /* flag for event / general receive order */
};
extern int posix_net_init(struct pp_instance *ppi);
extern int posix_net_check_pkt(struct pp_instance *ppi, int delay_ms);
extern int posix_open_ch(struct pp_instance *ppi, char *name);
extern int posix_open_ch(struct pp_instance *ppi, char *name, int chtype);
extern int posix_recv_packet(struct pp_instance *ppi, void *pkt, int len,
TimeInternal *t);
......
......@@ -71,8 +71,8 @@
#define PP_CLOCK_IDENTITY_LENGTH 8
#define PP_FLAG_FIELD_LENGTH 2
#define PP_PACKET_SIZE 300
#define PP_EVENT_PORT 319
#define PP_GENERAL_PORT 320
#define PP_EVT_PORT 319
#define PP_GEN_PORT 320
#define PP_DEFAULT_DOMAIN_ADDRESS "224.0.1.129"
#define PP_PEER_DOMAIN_ADDRESS "224.0.0.107"
#define PP_MM_STARTING_BOUNDARY_HOPS 0x7fff
......
......@@ -143,6 +143,7 @@ struct pp_servo {
#define PP_NP_GEN 0
#define PP_NP_EVT 1
#define PP_NP_LAST 1
struct pp_net_path {
struct pp_channel ch[2]; /* event and general channel (see above
* #define's */
......
......@@ -21,7 +21,8 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
/* Initialize default data set */
DSDEF(ppi)->twoStepFlag = PP_TWO_STEP_FLAG;
/* TODO initialize clockIdentity with MAC address */
pp_memcpy(DSDEF(ppi)->clockIdentity, NP(ppi)->ch[PP_NP_GEN].addr,
PP_CLOCK_IDENTITY_LENGTH);
DSDEF(ppi)->clockIdentity[3] = 0xff;
DSDEF(ppi)->clockIdentity[4] = 0xfe;
DSDEF(ppi)->numberPorts = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment