1 /* 2 * Copyright 2003-2005, Haiku Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 #ifndef _PPP_REPORT_DEFS__H 7 #define _PPP_REPORT_DEFS__H 8 9 #include <OS.h> 10 11 12 #define PPP_REPORT_TIMEOUT 100 13 14 #define PPP_REPORT_DATA_LIMIT 128 15 // how much optional data can be added to the report 16 #define PPP_REPORT_CODE '_3PR' 17 // the code of receive_data() must have this value 18 19 //! Report flags. 20 enum ppp_report_flags { 21 PPP_REMOVE_AFTER_REPORT = 0x01, 22 PPP_REGISTER_SUBITEMS = 0x02 23 }; 24 25 // report types 26 // the first 15 report types are reserved for the interface manager 27 #define PPP_INTERFACE_REPORT_TYPE_MIN 16 28 enum ppp_report_type { 29 PPP_ALL_REPORTS = -1, 30 // used only when disabling reports 31 PPP_MANAGER_REPORT = 1, 32 PPP_DESTRUCTION_REPORT = 16, 33 // the interface is being destroyed (no code is needed) 34 // this report is sent even if it was not requested 35 PPP_CONNECTION_REPORT = 17 36 }; 37 38 39 // report codes (type-specific) 40 enum ppp_manager_report_codes { 41 // the interface id is added to the following reports 42 PPP_REPORT_INTERFACE_CREATED = 0 43 }; 44 45 46 enum ppp_connection_report_codes { 47 // the interface id is added to the following reports 48 PPP_REPORT_GOING_UP = 0, 49 PPP_REPORT_UP_SUCCESSFUL = 1, 50 PPP_REPORT_DOWN_SUCCESSFUL = 2, 51 PPP_REPORT_DEVICE_UP_FAILED = 3, 52 PPP_REPORT_AUTHENTICATION_REQUESTED = 4, 53 PPP_REPORT_AUTHENTICATION_FAILED = 5, 54 PPP_REPORT_CONNECTION_LOST = 6 55 }; 56 57 58 //! This is the structure of a report message. 59 typedef struct ppp_report_packet { 60 int32 type; 61 int32 code; 62 uint8 length; 63 //!< Length of the additional data. 64 char data[PPP_REPORT_DATA_LIMIT]; 65 } ppp_report_packet; 66 67 68 //! Private structure used for storing report requests. 69 typedef struct ppp_report_request { 70 ppp_report_type type; 71 thread_id thread; 72 int32 flags; 73 } ppp_report_request; 74 75 76 #endif 77