/*
** pat_tr.h for  in 
** 
** Made by 
** Login   <vianney@epita.fr>
** 
** Started on  Wed Sep  1 06:46:42 1999 
** Last update Thu Oct 28 20:20:53 1999 
*/
#ifndef PAT_TR_H
#define PAT_TR_H	1

#include "pat.h"
#include "pat_ethaddr.h"

typedef struct			s_tr
{
  t_u8				ac;
  t_u8				fc;
  t_u8				dhost[6];
  t_u8				shost[6];
} t_tr;

#define TR_HLEN			14

#define PAT_TR_CHECK(trpar,bufpar,lenpar) \
	if ((lenpar) < TR_HLEN)\
		return (ERR_PAT_TRUNC_PAT);\
	(trpar) = (t_tr *)(bufpar);

#define TR_FRAMETYPE_MAC	0
#define TR_FRAMETYPE_LLC	1

extern t_pat			tr_pat;
extern t_pat			trrif_pat;

/* PROTO pat_tr.c */
/* pat_tr.c */
t_status trrif_pat_name P((void *data, t_id *optional_id, char *str, int max_len));
t_status trrif_pat_get_field P((void *data, t_id *optional_id, char *buf, int len, char *field, char *str, int max_len));
t_status trrif_pat_set_field P((void *data, t_id *optional_id, char *buf, int len, char *field, char *value));
t_status trrif_pat_get_fields P((void *data, t_vec *vec_str));
t_status trrif_pat_get_field_pat P((void *data, t_id *optional_id, char *buf, int len, char *field, t_pat **pat_return, void **data_return));
t_status trrif_pat_get_tmpl P((void *data, t_id *id, char *buf, int len, char *str, int max_len));
t_status trrif_pat_off P((void *data, char *buf, int len, t_off *off_return));
t_status trrif_pat_sub P((void *data, t_id *optional_id, char *buf, int len, t_pat **pat_return));
int tr_get_frametype P((t_tr *tr));
t_status tr_pat_name P((void *data, t_id *optional_id, char *str, int max_len));
t_status tr_pat_get_field P((void *data, t_id *optional_id, char *buf, int len, char *field, char *str, int max_len));
t_status tr_pat_set_field P((void *data, t_id *optional_id, char *buf, int len, char *field, char *value));
t_status tr_pat_get_fields P((void *data, t_vec *vec_str));
t_status tr_pat_get_field_pat P((void *data, t_id *optional_id, char *buf, int len, char *field, t_pat **pat_return, void **data_return));
t_status tr_pat_get_tmpl P((void *data, t_id *id, char *buf, int len, char *str, int max_len));
t_status tr_pat_off P((void *data, char *buf, int len, t_off *off_return));
t_status tr_pat_sub P((void *data, t_id *optional_id, char *buf, int len, t_pat **pat_return));
#endif
