関数 | |
static void | remove_lmb_browser_entry (struct browse_cache_record *browc) |
void | update_browser_death_time (struct browse_cache_record *browc) |
browse_cache_record * | create_browser_in_lmb_cache (const char *work_name, const char *browser_name, struct in_addr ip) |
browse_cache_record * | find_browser_in_lmb_cache (const char *browser_name) |
void | expire_lmb_browsers (time_t t) |
変数 | |
browse_cache_record * | lmb_browserlist |
static void remove_lmb_browser_entry | ( | struct browse_cache_record * | browc | ) | [static] |
nmbd_browserdb.c の 53 行で定義されています。
参照先 lmb_browserlist.
00054 { 00055 DLIST_REMOVE(lmb_browserlist, browc); 00056 SAFE_FREE(browc); 00057 }
void update_browser_death_time | ( | struct browse_cache_record * | browc | ) |
nmbd_browserdb.c の 67 行で定義されています。
参照先 browse_cache_record::death_time.
参照元 process_master_browser_announce().
00068 { 00069 /* Allow the new lmb to miss an announce period before we remove it. */ 00070 browc->death_time = time(NULL) + ( (CHECK_TIME_MST_ANNOUNCE + 2) * 60 ); 00071 }
struct browse_cache_record* create_browser_in_lmb_cache | ( | const char * | work_name, | |
const char * | browser_name, | |||
struct in_addr | ip | |||
) |
nmbd_browserdb.c の 84 行で定義されています。
参照先 Debug1()・lmb_browserlist・strupper_m().
参照元 process_master_browser_announce().
00087 { 00088 struct browse_cache_record *browc; 00089 time_t now = time( NULL ); 00090 00091 browc = SMB_MALLOC_P(struct browse_cache_record); 00092 00093 if( NULL == browc ) { 00094 DEBUG( 0, ("create_browser_in_lmb_cache: malloc fail !\n") ); 00095 return( NULL ); 00096 } 00097 00098 memset( (char *)browc, '\0', sizeof( *browc ) ); 00099 00100 /* For a new lmb entry we want to sync with it after one minute. This 00101 will allow it time to send out a local announce and build its 00102 browse list. 00103 */ 00104 00105 browc->sync_time = now + 60; 00106 00107 /* Allow the new lmb to miss an announce period before we remove it. */ 00108 browc->death_time = now + ( (CHECK_TIME_MST_ANNOUNCE + 2) * 60 ); 00109 00110 unstrcpy( browc->lmb_name, browser_name); 00111 unstrcpy( browc->work_group, work_name); 00112 strupper_m( browc->lmb_name ); 00113 strupper_m( browc->work_group ); 00114 00115 browc->ip = ip; 00116 00117 DLIST_ADD_END(lmb_browserlist, browc, struct browse_cache_record *); 00118 00119 if( DEBUGLVL( 3 ) ) { 00120 Debug1( "nmbd_browserdb:create_browser_in_lmb_cache()\n" ); 00121 Debug1( " Added lmb cache entry for workgroup %s ", browc->work_group ); 00122 Debug1( "name %s IP %s ", browc->lmb_name, inet_ntoa(ip) ); 00123 Debug1( "ttl %d\n", (int)browc->death_time ); 00124 } 00125 00126 return( browc ); 00127 }
struct browse_cache_record* find_browser_in_lmb_cache | ( | const char * | browser_name | ) |
nmbd_browserdb.c の 138 行で定義されています。
参照先 lmb_browserlist・browse_cache_record::lmb_name・browse_cache_record::next・strequal().
参照元 process_master_browser_announce().
00139 { 00140 struct browse_cache_record *browc; 00141 00142 for( browc = lmb_browserlist; browc; browc = browc->next ) { 00143 if( strequal( browser_name, browc->lmb_name ) ) { 00144 break; 00145 } 00146 } 00147 00148 return browc; 00149 }
void expire_lmb_browsers | ( | time_t | t | ) |
nmbd_browserdb.c の 160 行で定義されています。
参照先 browse_cache_record::death_time・Debug1()・lmb_browserlist・browse_cache_record::lmb_name・browse_cache_record::next・remove_lmb_browser_entry().
参照元 dmb_expire_and_sync_browser_lists().
00161 { 00162 struct browse_cache_record *browc; 00163 struct browse_cache_record *nextbrowc; 00164 00165 for( browc = lmb_browserlist; browc; browc = nextbrowc) { 00166 nextbrowc = browc->next; 00167 00168 if( browc->death_time < t ) { 00169 if( DEBUGLVL( 3 ) ) { 00170 Debug1( "nmbd_browserdb:expire_lmb_browsers()\n" ); 00171 Debug1( " Removing timed out lmb entry %s\n", browc->lmb_name ); 00172 } 00173 remove_lmb_browser_entry( browc ); 00174 } 00175 } 00176 }
struct browse_cache_record* lmb_browserlist |